package com.huw.NewBie;

import javax.microedition.khronos.opengles.GL10;

import org.anddev.andengine.entity.particle.ParticleSystem;
import org.anddev.andengine.entity.particle.emitter.CircleParticleEmitter;
import org.anddev.andengine.entity.particle.initializer.AccelerationInitializer;
import org.anddev.andengine.entity.particle.initializer.AlphaInitializer;
import org.anddev.andengine.entity.particle.initializer.ColorInitializer;
import org.anddev.andengine.entity.particle.initializer.VelocityInitializer;
import org.anddev.andengine.entity.particle.modifier.AlphaModifier;
import org.anddev.andengine.entity.particle.modifier.ExpireModifier;
import org.anddev.andengine.entity.scene.Scene;

import com.light.roller.ResourceManager;
import com.light.roller.Roller;

public class ParticleEffect2 extends ParticleEffect{

	public ParticleEffect2(Roller game) {
		super(game);
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public void onLoadResources()
	{
		ResourceManager.onLoadResources("particle_small_point",m_game);
	}
	
	@Override
	public void onLoadScene(final Scene scene)
	{
		m_scene = scene;	
		ParticleSystemRadius = 30;
		expireTIme = 2f;
		
		particleEmitter = new CircleParticleEmitter(0, 0, ParticleSystemRadius);
		particleSystem = new ParticleSystem(particleEmitter, 1000, 1000, 75,ResourceManager.getTextureRegion("particle_small_point"));
	
		particleSystem.addParticleInitializer(new ColorInitializer(1,1,1));
		particleSystem.addParticleInitializer(new AlphaInitializer(1));
		particleSystem.addParticleInitializer(new NewBieSizeInitializer(44,66,44,66));
		particleSystem.addParticleInitializer(new NewBieVelocityInitializer(100,100));
		
		particleSystem.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE);
		particleSystem.addParticleModifier(new AlphaModifier(1, 0, 1.8f, 2.0f));
		//particleSystem.addParticleModifier(new NewBieRotationModifier(4,0,expireTIme+1));				
	
		
		particleSystem.setIgnoreUpdate(true);
	}

}
